#include "battery.h"

void Battery::setModel(const std::string& model) {
    this->model = model;
}

void Battery::setCapacity(const std::string& capacity) {
    this->capacity = capacity;
}

void Battery::setChargeTime(const std::string& charge_time) {
    this->charge_time = charge_time;
}

void Battery::print() const {
    std::cout << "电池型号: " << model << std::endl;
    std::cout << "电池容量: " << capacity << std::endl;
    std::cout << "充电时间: " << charge_time << std::endl;
}

void Battery::save(std::ofstream& out) const {
    out << "电池型号: " << model << std::endl;
    out << "电池容量: " << capacity << std::endl;
    out << "充电时间: " << charge_time << std::endl;
}